import React, { Dispatch } from 'react';

/** 定义管理页面上下文 */
export interface IManageContext {
  dispatch: Dispatch<any>;
  prefixCls: string;
  isView: boolean;
  activeKeys: Array<string>;
  activeKey: Array<string>;
  expertsInfo: Record<string, any>;
  curRes: Record<string, any>;
  expertQualifies: Record<string, any>[];
  locationProps?: Record<string, any>;
}

/** 初始化管理页面上下文 */
const init_manage_context: IManageContext = {
  prefixCls: 'experts-update-',
  activeKeys: ['baseInfo', 'documentInfo', 'certificateInfo', 'phoneInfo', 'otherInfo'],
  activeKey: ['baseInfo', 'documentInfo', 'certificateInfo', 'phoneInfo', 'otherInfo'],
  dispatch: () => {},
  locationProps: {},
  expertsInfo: {},
  expertQualifies: [],
  isView: true,
  curRes: {},
};

/** 创建更新专家库管理上下文 */
const ExpertsUpdateContext = React.createContext(init_manage_context);

export { ExpertsUpdateContext };
